package net.jjjshop.common.service.lbt.impl;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import net.jjjshop.common.entity.lbt.JybUserPaytypeEntity;
import net.jjjshop.common.mapper.lbt.JybUserPaytypeMapper;
import net.jjjshop.common.service.lbt.JybUserPaytypeService;
import net.jjjshop.framework.util.LoginUtil;
import org.springframework.stereotype.Service;


/**
 * 用户交易支付方式 接口实现类

 */

@Service("jybUserPaytypeService")
public class JybUserPaytypeServiceImpl extends ServiceImpl<JybUserPaytypeMapper, JybUserPaytypeEntity> implements JybUserPaytypeService {



    @Override
    public IPage<JybUserPaytypeEntity> getList(Integer page, Integer limit) {
        Integer UserId = LoginUtil.getLoginUserRedisVo().getUserId();
        Page<JybUserPaytypeEntity> pageUser = new Page<JybUserPaytypeEntity>(page, limit);
        LambdaQueryWrapper<JybUserPaytypeEntity> lqw = new LambdaQueryWrapper<>();
        lqw.eq(JybUserPaytypeEntity::getUid, UserId);
        lqw.orderByDesc(JybUserPaytypeEntity::getCreateTime);
        Page<JybUserPaytypeEntity> entityPage = this.page(pageUser, lqw);
        return entityPage;
    }


}
